#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int miss(int* arr, int len) {
	int x = 0;
	for (int i = 0; i < len; i++) {
		x ^= arr[i];
	}
	for (int i = 0; i < len + 1; i++) {
		x ^= i;
	}
	return x;
}
int sum(int* arr, int len) {
	int x = (1 + len) * len / 2;
	for (size_t i = 0; i < len; i++) {
		x -= arr[i];
	}
	return x;
}
int main() {
	int arr[] = {9,5,7,2,1,4,6,0,3};
	//int ref = miss(arr, 9);
	int ref = sum(arr, 9);
	printf("%d\n", ref);
	return 0;
}